<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>毕业选题系统</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
	<meta name="author" content="Muhammad Usman">

	<!-- The styles -->
	<link id="bs-css" href="<%=basePath %>bootstrap/css/bootstrap-cerulean.css" rel="stylesheet">
	<style type="text/css">
	  body {
		padding-bottom: 40px;
	  }
	  .sidebar-nav {
		padding: 9px 0;
	  }
	</style>
	<link href="<%=basePath %>bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="<%=basePath %>bootstrap/css/charisma-app.css" rel="stylesheet">
	<link href="<%=basePath %>bootstrap/css/jquery-ui-1.8.21.custom.css" rel="stylesheet">
	<link href='<%=basePath %>bootstrap/css/fullcalendar.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/fullcalendar.print.css' rel='stylesheet'  media='print'>
	<link href='<%=basePath %>bootstrap/css/chosen.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/uniform.default.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/colorbox.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/jquery.cleditor.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/jquery.noty.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/noty_theme_default.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/elfinder.min.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/elfinder.theme.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/jquery.iphone.toggle.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/opa-icons.css' rel='stylesheet'>
	<link href='<%=basePath %>bootstrap/css/uploadify.css' rel='stylesheet'>
	<!-- jQuery -->
	<script src="<%=basePath %>js/jquery/jquery-1.11.0.min.js"></script>
	<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
		
</head>

<body>
		<div class="container-fluid">
		<div class="row-fluid">
		
			<div class="row-fluid">
				<div class="span12 center login-header">
					<h2>欢迎使用毕业选题系统</h2>
				</div><!--/span-->
			</div><!--/row-->
			
			<div class="row-fluid">
				<div class="well span5 center login-box">
					<div class="alert alert-info" id="info_div">
						请输入用户名和密码
					</div>
					<form class="form-horizontal">
						<fieldset>
							<div class="input-prepend" title="用户名" data-rel="tooltip">
								<span class="add-on"><i class="icon-user"></i></span><input autofocus class="input-large span10" name="username" id="username" type="text" value="" />
							</div>
							<div class="clearfix"></div>

							<div class="input-prepend" title="密码" data-rel="tooltip">
								<span class="add-on"><i class="icon-lock"></i></span><input class="input-large span10" name="password" id="password" type="password" value="" />
							</div>
							<div class="clearfix"></div>

<!-- 							<div class="input-prepend"> -->
<!-- 							<label class="remember" for="remember"><input type="checkbox" id="remember" />记住密码</label> -->
<!-- 							</div> -->
							<div class="clearfix"></div>

							<p class="center span5">
							<button type="button" class="btn btn-primary" id="login_btn">登陆</button>
							</p>
						</fieldset>
					</form>
				</div><!--/span-->
			</div><!--/row-->
		</div><!--/fluid-row-->
		
	</div><!--/.fluid-container-->
	<!--  js -->
	<script type="text/javascript">
	$(document).ready(function(){
		  $("#login_btn").click(function(){
				var no=$("#username").val();
				var password=$("#password").val();
				$.post("login",{no:no,password:password},
					function(data,textStatus){
						if(textStatus=="success"){
							
							switch (data) {
							case "1":
								window.location="student/info";
								break;
							case "2":
								window.location="teacher/teacher_home";
								break;
							case "3":
								window.location="admin/profile";
								break;
							case "-1":
								$("#info_div").html("用户名不存在");
								$("#info_div").attr("class","alert alert-error");
								break;
							case "-2":
								$("#info_div").html("密码错误");
								$("#info_div").attr("class","alert alert-error");
								break;
							case "-3":
								$("#info_div").html("请输入密码!");
								$("#info_div").attr("class","alert alert-error");
								break;
							default:
								break;
						}
					}
				}, "text");
			});
		});
	</script>
	<!-- external javascript
	================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->


	<!-- jQuery UI -->
	<script src="<%=basePath %>js/jquery/jquery-ui-1.8.21.custom.min.js"></script>
	<!-- transition / effect library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-transition.js"></script>
	<!-- alert enhancer library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-alert.js"></script>
	<!-- modal / dialog library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-modal.js"></script>
	<!-- custom dropdown library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-dropdown.js"></script>
	<!-- scrolspy library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-scrollspy.js"></script>
	<!-- library for creating tabs -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-tab.js"></script>
	<!-- library for advanced tooltip -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-tooltip.js"></script>
	<!-- button enhancer library -->
	<script src="<%=basePath %>bootstrap/js/bootstrap-button.js"></script>


	<!-- application script for Charisma demo -->
	<script src="<%=basePath %>js/other/charisma.js"></script>
	
		
</body>
</html>